<?
	$cmsDocument->addConstraint('value',"<<NULL>>",'IS');	// magic hax0r for nullness.. means we dont see empty ines..
	$topic = extractNumberWithKeyFromArray('topic', $_REQUEST, null);
	if (!is_null($topic)) {
		$cmsDocument->addConstraint('categorycode',$topic,'=');
	}
	
	$upUrl = $_SERVER['PHP_SELF'] . '?fileNo=1&formid=124';
	$returnURL = $_SERVER['PHP_SELF'] . "?fileNo=1&formid=123&sorts=clear&direction=clear&pageNumber=$pageNumber&topic=$topic";
	$cancelURL = $returnURL;	
?>
<TABLE class="cms_browsetext" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR> 
<TH align="left" width="35">&nbsp;</TH>
<TH align="left" ><A href="#">Title</A></TH>
<TH width="75" align="left">Action</TH>
</TR>
<?


	$cmsDocument->resetIterator();
	
	if ( $cmsDocument->totalDocuments() > 0) {
	 
		while(($row = $cmsDocument->nextDocument())){
			$postingUrl = $_SERVER['PHP_SELF'] . "?fileNo=" . FILE_POSTINGS . "&documentCode=" . $row->documentcode . "&topic=" . $topic;
		
?>
<TR> 
<TD align="left" colSpan="3"><IMG height="7" src="/cms/images/greyline.gif" width="100%"></TD>
</TR>

<TR> 
<TD class="cms_browsetext" width="35"><a href="<?= $postingUrl ?>" ><img src="/cms/html/postings/images/icon_comment.gif" ></a></TD>
<TD class="cms_browsetext"><a href="<?= $postingUrl ?>" ><?= magicClean($row->title)?></a></TD>
<TD class="cms_browsetext" width="75">
<?
if ( deleteFormAuth($authInfo, $formDescription, $row->documentcode, $db) ) {
?>
<a href="/cms/html/index.php?fileNo=4&documentCode=<? print($row->documentcode); ?>&returnURLEncoded=<?= urlencode($returnURL) ?>&cancelURLEncoded=<?= urlencode($cancelURL) ?>" >Delete</a>
<?
}
?>
</TD>
</TR>
<?
		}
	} else {
?>	
<TR> 
<TD align="left" colSpan="3"><IMG height="7" src="/cms/images/greyline.gif" width="100%"></TD>
</TR>

<TR> 
<TD class="cms_browsetext" width="35"><img src="/cms/images/spacer.gif" height="20" /></TD>
<TD class="cms_browsetext" ><i>No postings have been entered in this discussion forum</i></TD>
<TD class="cms_browsetext" width=75>&nbsp;</TD>
</TR>

<?
	}
?>
<TR> 
<TD align="left" colSpan="3"><IMG height="7" src="/cms/images/greyline.gif" width="100%" /></TD>
</TR>
<TR> 
<TD class="cms_browsetext" width="35"><a href="<?= $upUrl ?>"><img src="/cms/html/postings/images/icon_folderup.gif" width="35" height="20" /></a></TD>
<TD class="cms_browsetext" ><a href="<?= $upUrl ?>"><i>.. View all discussion forums.<i></a></TD>
<TD class="cms_browsetext" width="75"></td>
</TR>
<TR> 
<TD align="left" colSpan="3"><IMG height="7" src="/cms/images/greyline.gif" width="100%"></TD>
</TR>
</TABLE>
<?
	// get the formDescription for the thingee..
	$topicGid = null;
	if (!is_null($topic)) {
		$topicContent = $cmsDocument->openDocument($topic);
		if (!is_null($topicContent)) {
			$topicGid = $topicContent->gid;
		}
	}
//	displayGoAdd($formDescription, $authInfo, $topicGid, array( 'topic'=> $topic, 'fileNo' => FILE_POSTINGS ) , $db);

	$addMode = CMS_ADD_QUICK_ADD_GO;
	//$addUrl = "";
	$addUrlDict = array(
		'topic'=> $topic, 
		'fileNo' => FILE_POSTINGS,
		'gid' => $topicGid
	);
?>